function varargout = urlread_via_web(varargin)
% URLREAD_VIA_WEB M-file for urlread_via_web.fig
%      URLREAD_VIA_WEB, by itself, creates a new URLREAD_VIA_WEB or raises the existing
%      singleton*.
%
%      H = URLREAD_VIA_WEB returns the handle to a new URLREAD_VIA_WEB or the handle to
%      the existing singleton*.
%
%      URLREAD_VIA_WEB('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in URLREAD_VIA_WEB.M with the given input arguments.
%
%      URLREAD_VIA_WEB('Property','Value',...) creates a new URLREAD_VIA_WEB or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before urlread_via_web_OpeningFunction gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to urlread_via_web_OpeningFcn via varargin.
%
%      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
%      instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help urlread_via_web

% Last Modified by GUIDE v2.5 17-Jan-2007 12:13:25

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @urlread_via_web_OpeningFcn, ...
                   'gui_OutputFcn',  @urlread_via_web_OutputFcn, ...
                   'gui_LayoutFcn',  [] , ...
                   'gui_Callback',   []);
if nargin && ischar(varargin{1})
    gui_State.gui_Callback = str2func(varargin{1});
end

if nargout
    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
    gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT


% --- Executes just before urlread_via_web is made visible.
function urlread_via_web_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% varargin   command line arguments to urlread_via_web (see VARARGIN)

% Choose default command line output for urlread_via_web
handles.output = hObject;

% Update handles structure
guidata(hObject, handles);

% UIWAIT makes urlread_via_web wait for user response (see UIRESUME)
% uiwait(handles.figure1);


% --- Outputs from this function are returned to the command line.
function varargout = urlread_via_web_OutputFcn(hObject, eventdata, handles) 
% varargout  cell array for returning output args (see VARARGOUT);
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure
varargout{1} = handles.output;


% --- Executes on button press in open_web_button.
function open_web_button_Callback(hObject, eventdata, handles)
%
%h=web(get(handles.url_here,'String'));
[h,mis]=web(get(handles.url_here,'String'));
html=get(mis,'HtmlText');
fid=fopen('lixa.html','w');
fprintf(fid,'%s',html);
fclose(fid);
save lixa html
%set(handles.h_txt,'String',a)
%disp(':-)')
% hObject    handle to open_web_button (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)



function url_here_Callback(hObject, eventdata, handles)
% hObject    handle to url_here (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of url_here as text
%        str2double(get(hObject,'String')) returns contents of url_here as a double


% --- Executes during object creation, after setting all properties.
function url_here_CreateFcn(hObject, eventdata, handles)
% hObject    handle to url_here (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end




% --- Executes on selection change in h_fields.
function h_fields_Callback(hObject, eventdata, handles)
% hObject    handle to h_fields (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = get(hObject,'String') returns h_fields contents as cell array
%        contents{get(hObject,'Value')} returns selected item from h_fields


% --- Executes during object creation, after setting all properties.
function h_fields_CreateFcn(hObject, eventdata, handles)
% hObject    handle to h_fields (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: listbox controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


